package com.frxuexi.lib_base

import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.material3.Icon
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.style.TextAlign
import androidx.navigation.NavHostController

@Composable
fun BaseTitle(title:String,navHostController:NavHostController) {
    Box(contentAlignment = Alignment.CenterStart) {
        Text(text = title, textAlign = TextAlign.Center, modifier = Modifier.fillMaxWidth())
        Icon(imageVector = Icons.Default.ArrowBack, contentDescription = "", Modifier.clickable {
            //返回上个页面
            navHostController.popBackStack()
        })
    }
}